package org.example.chat.websocket.entity;

import lombok.Data;

@Data
public class QueueMessage<T> {

    private Type type;
    private T msg;
    private String receiverId;

    public QueueMessage(String receiverId ,T msg, Type type) {
        if (receiverId == null) {
            throw new RuntimeException("receiverId is not null");
        }
        if (type == null) {
            throw new RuntimeException("type is not null");
        }
        this.receiverId = receiverId;
        this.type = type;
        this.msg = msg;
    }



    public enum Type {
        SIGNAL,  // 发送到单聊ChannelGroup
        GROUP,    // 发送到群聊ChannelGroup
        NO_PUBLIC;  // 发送到公众号的ChannelGroup
    }
}
